#pragma once
#include "WareTypes.h"
#include "WareComDef.h"
#include "WareCommonNameSpace.h"
#include <fstream>
using namespace std;

BEGIN_WARECOMMON

class CWareFileWrite
{
public:
	CWareFileWrite( VBOOL bTextMode = VFALSE, VBOOL bApp = VFALSE ) : m_bTextMode(bTextMode), m_bApp(bApp) {}
	~CWareFileWrite(void) {}

	VBOOL	Open( const VCHAR* szFileName );
	void	Close();

	VBOOL	IsEOF()	{ return m_Out.eof(); }

	void	Seek( uint32 uOffset, EFilePos eFilePos );
	VBOOL	Write( const void* pBuff, int32 nCount );
	void	WriteLine( const VCHAR* pBuff );
	uint32	Tell();

private:
	VBOOL		m_bTextMode;
	VBOOL		m_bApp;

	ofstream	m_Out;
};

END_WARECOMMON
